﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InfernoWarriors.Engine.Managers
{
    public class UnitManager
    {
        private List<UnitBase> units;
 
        public UnitBase GetUnitByID(Guid id)
        {
            return units.First(x => x.ID == id);
        }

        public bool AddUnit(UnitBase unit)
        {
            if (units.Any(x => x.ID == unit.ID)) return false;

            units.Add(unit);
            return true;
        }

        public bool KillUnit(UnitBase unit)
        {
            if (!units.Any(x => x.ID == unit.ID)) return false;

            units.Remove(unit);
            return true;
        }
    }
}
